﻿// ==========================================================
// File: TeamWorkNet.Portable.Account.cs
// Created: 14.02.2015
// Created By: Tim cadenbach
// 
// Copyright (C) 2015 Tim Cadenbach
// License: Apache License 2.0
// ==========================================================

using Newtonsoft.Json;

namespace TeamWorkNet.Model
{
  public class Account
  {
    [JsonProperty("requirehttps")]
    public bool Requirehttps { get; set; }

    [JsonProperty("time-tracking-enabled")]
    public bool TimeTrackingEnabled { get; set; }

    [JsonProperty("name")]
    public string Name { get; set; }

    [JsonProperty("datesignedup")]
    public string Datesignedup { get; set; }

    [JsonProperty("companyname")]
    public string Companyname { get; set; }

    [JsonProperty("ssl-enabled")]
    public bool SslEnabled { get; set; }

    [JsonProperty("created-at")]
    public string CreatedAt { get; set; }

    [JsonProperty("cacheUUID")]
    public string CacheUUID { get; set; }

    [JsonProperty("account-holder-id")]
    public string AccountHolderId { get; set; }

    [JsonProperty("logo")]
    public string Logo { get; set; }

    [JsonProperty("id")]
    public string Id { get; set; }

    [JsonProperty("URL")]
    public string URL { get; set; }

    [JsonProperty("email-notification-enabled")]
    public bool EmailNotificationEnabled { get; set; }

    [JsonProperty("companyid")]
    public string Companyid { get; set; }

    [JsonProperty("lang")]
    public string Lang { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [JsonProperty("code")]
    public string Code { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [JsonProperty("canaddprojects")]
    public string canaddprojects { get; set; }

    public bool CanAddProjects
    {
      get { return canaddprojects != "0"; }
    }


    /// <summary>
    /// 
    /// </summary>
    [JsonProperty("userIsMemberOfOwnerCompany")]
    public string UserIsMemberOfOwnerCompany { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public bool IsMemberOfOwnerCompany
    {
      get { return UserIsMemberOfOwnerCompany == "yes" ? true : false; }
    }


    [JsonProperty("userIsAdmin")]
    public bool UserIsAdmin { get; set; }


    [JsonProperty("canManagePeople")]
    public string canManagePeople { get; set; }

    public bool CanManagePeople
    {
      get { return canManagePeople != "0"; }
    }

    [JsonProperty("firstname")]
    public string Firstname { get; set; }

    [JsonProperty("dateSeperator")]
    public string DateSeperator { get; set; }

    [JsonProperty("timeFormat")]
    public string TimeFormat { get; set; }


    [JsonProperty("avatar-url")]
    public string AvatarUrl { get; set; }

    [JsonProperty("startonsundays")]
    public bool Startonsundays { get; set; }


    [JsonProperty("dateFormat")]
    public string DateFormat { get; set; }

    [JsonProperty("userId")]
    public int UserId { get; set; }

    [JsonProperty("lastname")]
    public string Lastname { get; set; }
  }
}
